<template>
  <ViewBox>
    <ControlItem v-for="(d, i) of dataCore.controls" :key="i" :d="d" :index="i" />
  </ViewBox>
</template>

<script>
// import OutsideClose from '@/modules/corejs/dom/outside-close'
import dataApi from '@/view/data-api-edit'
import ViewBox from './v/ViewBox'
import ControlItem from './ControlItems/IndexEdit'
export default {
  components: {
    ViewBox,
    ControlItem
  },
  computed: {
    dataCore () {
      return dataApi.core
    }
  },
  mounted () {
    dataApi.eBox = this.$el.parentElement
    // this.outsideClose = new OutsideClose({
    //   onClose () {
    //     dataApi.activeIndex = -1
    //   },
    //   check (eventElement) {
    //     let className = eventElement.className || ''
    //     if (className.indexOf) return className.indexOf('cke') > -1
    //   }
    // })
  }
  // methods: {
  //   onActive () {
  //     this.outsideClose.on()
  //   }
  // }
}
</script>
